<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Attachment extends Model
{
    use HasFactory;

    protected $fillable = [
        'carrier_id',
        'uid',
        'filename',
        'attachment',
        'type'
    ];

    protected $appends = ['url'];

    public function getUrlAttribute()
    {
        return config('app.url').'/storage/'.$this->attachment;
    }
}
